If (WinampCtrl.GetPlayListLength > 0) Then 'Playlist is not empty
Pos = WinampCtrl.GetPlayListPosition - 1
WinampCtrl.GetPlayList 'add to speeed up
playList(Pos)
End If
am.Update
End Sub
Sub playList(p)
Dim Show, Length
am.Clear
am.Title = "Playlist: " & CStr(p+1)
Pos = p 'var needed to pass to functions: prevSongs, nextSongs, playSongs(1..9)
'WinampCtrl.GetPlayList 'remove to speed up remove only if no adding or removing songs during playlist use (2000+ songs
Length = WinampCtrl.GetPlayListLength
Show = Length - p 'songs to be shown, remaining songs
If (p > 0) Then am.AddItem MenuItemPrevSongs, "prevSongs" 'if first song of playlist is not shown
If (Show > 0) Then am.AddItem getSong(p), "playSong1"
If (Show > 1) Then am.AddItem getSong(p+1), "playSong2"
If (Show > 2) Then am.AddItem getSong(p+2), "playSong3"
If (Show > 3) Then am.AddItem getSong(p+3), "playSong4"
If (Show > 4) Then am.AddItem getSong(p+4), "playSong5"
If (Show > 5) Then am.AddItem getSong(p+5), "playSong6"
If (Show > 6) Then am.AddItem getSong(p+6), "playSong7"
If (Show > 7) Then am.AddItem getSong(p+7), "playSong8"
If ( (Show>8 and p=0) Or (Show=9) ) Then am.AddItem getSong(p+8), "playSong9"
If (Length=10 and p=0) Then
am.AddItem getSong(p+9), "playSong10"
ElseIf (Show > 9) Then 'Length <> 10
am.AddItem MenuItemNextSongs, "nextSongs" 'if there are more then 10 remaining songs
End If
am.Back = "onAMWinamp"
am.Update
End Sub
Sub prevSongs
Pos = Pos-8 'back 8 songs what if there are 18 songs? and Show =9
If (Pos<2) Then Pos = 0
playList(Pos) 'Show new playlist with song# (Pos) as top of the list
End Sub
Sub nextSongs
If (Pos = 0) Then 'forward 9 songs if at beginning of list
Pos=Pos+9
Else
Pos=Pos+8 'forward 8 songs if not at beginning of list
End If
playList(Pos) 'Show new playlist with song# (Pos) as top of the list
End Sub
Sub playSong1 'clicked on song-event
playSong(Pos) 'play song being shown on top (Pos = value top song)
End Sub
Sub playSong2 'clicked on song-event
playSong(Pos+1) 'play song being shown on top as 2nd (Pos = value top song) + 1 offset
End Sub
Sub playSong3
playSong(Pos+2)
End Sub
Sub playSong4
playSong(Pos+3)
End Sub
Sub playSong5
playSong(Pos+4)
End Sub
Sub playSong6
playSong(Pos+5)
End Sub
Sub playSong7
playSong(Pos+6)
End Sub
Sub playSong8
playSong(Pos+7)
End Sub
Sub playSong9
playSong(Pos+8)
End Sub
Sub playSong10
playSong(Pos+9)
End Sub
Sub playSong(i) 'function called by clicked on song events song
If ( (WinampCtrl.GetSongState = "playing") And (WinampCtrl.GetPlayListPosition-1 = i) ) Then 'clicked on a song that is being played then show song info
songInfo(i)
Else 'if song is not being played
WinampCtrl.PlaySongByPosition(i) 'then play song and
playList(i) 'show playlist with song# i at top of list
End If
End Sub
Function getSong(p) 'return songtitle of song p
Dim i ,limit ,Str ,s ,size, width, mark
Width = ScreenWidth-13 'width available pixels t610:112 t68i = 94
s = filter(WinampCtrl.GetSongTitlebyPosition(p))
s = replace(s,"( ","(") 'reading songs with " char causes lockup
s = replace(s," )",")") 'reading songs with " char causes lockup
s = replace(s,"[ ","[") 'reading songs with " char causes lockup